package com.wordlearning.third.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 第三方服务配置属性类
 * 读取application.properties中的第三方服务配置项
 */
@Component
@ConfigurationProperties(prefix = "third-party")
public class ThirdPartyProperties {
    
    // Kitten TTS配置
    private final KittenTtsConfig kittenTts = new KittenTtsConfig();
    
    // 其他第三方服务配置可以在这里添加
    
    /**
     * 获取Kitten TTS配置
     * @return KittenTtsConfig实例
     */
    public KittenTtsConfig getKittenTts() {
        return kittenTts;
    }
    
    /**
     * Kitten TTS配置类
     */
    public static class KittenTtsConfig {
        // API服务地址
        private String apiUrl = "http://localhost:8000";
        
        // API请求超时时间（毫秒）
        private int timeout = 30000;
        
        // 默认语言
        private String defaultLanguage = "en-us";
        
        // 默认语音
        private String defaultVoice = "expr-voice-5-m";
        
        // 默认语速
        private double defaultSpeed = 1.0;
        
        public String getApiUrl() {
            return apiUrl;
        }
        
        public void setApiUrl(String apiUrl) {
            this.apiUrl = apiUrl;
        }
        
        public int getTimeout() {
            return timeout;
        }
        
        public void setTimeout(int timeout) {
            this.timeout = timeout;
        }
        
        public String getDefaultLanguage() {
            return defaultLanguage;
        }
        
        public void setDefaultLanguage(String defaultLanguage) {
            this.defaultLanguage = defaultLanguage;
        }
        
        public String getDefaultVoice() {
            return defaultVoice;
        }
        
        public void setDefaultVoice(String defaultVoice) {
            this.defaultVoice = defaultVoice;
        }
        
        public double getDefaultSpeed() {
            return defaultSpeed;
        }
        
        public void setDefaultSpeed(double defaultSpeed) {
            this.defaultSpeed = defaultSpeed;
        }
    }
}